-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve dev env experience after Ruby version updates #11670
base: main
Are you sure you want to change the base?
Conversation
@@ -96,6 +96,8 @@ gem 'zxcvbn', '0.1.12' | |||
group :development do | |||
gem 'better_errors', '>= 2.5.1' | |||
gem 'derailed_benchmarks' | |||
# Putting foreman here saves developers from having bin/setup when the Ruby version changes | |||
gem 'foreman', require: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to change the foreman
invocation in the Makefile to bundle exec foreman
in the case the gem is installed locally. However I think that will error out if the gem is installed system-wide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. In my environment, I tried adding this line to the Gemfile to see if using bundle exec foreman
was required, and I didn't need it. I am using rbenv
, and I'd like to see if anyone not using rbenv
also finds this okay.
Here's what happened when I added it to the Gemfile before and after running `bundle install`
➜ identity-idp git:(main) ✗ make run
yarn generate-browsers-json
yarn run v1.22.22
$ ./scripts/generate-browsers-json.js
✨ Done in 0.19s.
foreman start -p 3000
rbenv: foreman: command not found
The `foreman' command exists in these Ruby versions:
3.2.0
3.2.2
3.3.0
3.3.1
3.3.4
make: *** [run] Error 127
➜ identity-idp git:(main) ✗ bundle
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Fetching foreman 0.88.1
Installing foreman 0.88.1
WARN: Unresolved or ambiguous specs during Gem::Specification.reset:
stringio (>= 0)
Available/installed versions of this gem:
- 3.1.2
- 3.1.1
WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
Please report a bug if this causes problems.
Bundle complete! 127 Gemfile dependencies, 279 gems now installed.
Gems in the groups 'deploy' and 'production' were not installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
➜ identity-idp git:(main) ✗ make run
foreman start -p 3000
13:22:49 web.1 | started with pid 5871
13:22:49 worker.1 | started with pid 5872
13:22:49 js.1 | started with pid 5873
13:22:49 css.1 | started with pid 5874
13:22:49 js.1 | yarn run v1.22.22
13:22:49 css.1 | yarn run v1.22.22
[etc]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foreman recommends against putting it in the Gemfile:
Ruby users should take care not to install foreman in their project's Gemfile. See this wiki article for more details.
The reasoning described in the wiki article seems sensible enough to me to not include it.
changelog: Internal, Local Development, Improving development experience after recent Ruby version upgrade
62df362
to
075bd96
Compare
@@ -2,6 +2,5 @@ brew 'postgresql@14' | |||
brew 'redis' | |||
brew 'node@22' | |||
brew 'yarn' | |||
brew '[email protected]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of our deployed environments still use openssl 1.1, so I think it'd be preferable to keep it as-is for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to resolve the fact that this prevents engs from deploying idp on their local environments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the dependency for the environments that still use openssl 1.1? Login.gov is very good about keeping important things like Ruby versions up to date, which is why this change felt safe to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have done this is as a full review, but I added a couple comments that I consider blockers at the moment.
Additional context is that having |
🛠 Summary of changes
After #11605 was merged, @ajfarkas and I noticed that a couple small changes may help developers update their local dev environments.
[email protected]
listed in their Brewfile to ensure older Ruby versions are able to build against it. I'm removing it assuming that's why it was added. Of note:asdf
andrbenv
leverage theruby-build
Homebrew formula to manage Ruby-specific OpenSSL dependencies when installing older versionsbin/setup
, a script that also clobbers any local db entries. Adding the Foreman to the gemfile like this means thatmake update
will also make sure an appropriate version of Foreman is always installed without dropping db tablesI was tempted to remove the Foreman-specific step from
bin/setup
entirely. I wasn't sure if it's called anywhere automatically, like referenced in an important Terraform script or the like, so I left it alone for now.